package org.insia.smartposse.mapping.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the application table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="application"
 */

public abstract class BaseApplication  implements Serializable {

	public static String REF = "Application";
	public static String PROP_FROM = "From";
	public static String PROP_JOB_PROJECT = "JobProject";
	public static String PROP_COMMENT_FREELANCE = "CommentFreelance";
	public static String PROP_GRADE_MANAGER = "GradeManager";
	public static String PROP_GRADE_FREELANCE = "GradeFreelance";
	public static String PROP_SALARY = "Salary";
	public static String PROP_MESSAGE = "Message";
	public static String PROP_COMMENT_MANAGER = "CommentManager";
	public static String PROP_FREELANCE = "Freelance";
	public static String PROP_ID = "Id";
	public static String PROP_ACCEPT = "Accept";


	// constructors
	public BaseApplication () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseApplication (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseApplication (
		java.lang.Integer id,
		double salary,
		java.lang.Integer accept,
		java.lang.Integer gradeManager,
		java.lang.Integer gradeFreelance) {

		this.setId(id);
		this.setSalary(salary);
		this.setAccept(accept);
		this.setGradeManager(gradeManager);
		this.setGradeFreelance(gradeFreelance);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer accept;
	private java.lang.String commentFreelance;
	private java.lang.String commentManager;
	private java.lang.Integer gradeFreelance;
	private java.lang.Integer gradeManager;
	private java.lang.String message;
	private double salary;

	// many to one
	private org.insia.smartposse.mapping.Users freelance;
	private org.insia.smartposse.mapping.Users from;
	private org.insia.smartposse.mapping.JobProject jobProject;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="increment"
     *  column="application_id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: accept
	 */
	public java.lang.Integer getAccept () {
		return accept;
	}

	/**
	 * Set the value related to the column: accept
	 * @param accept the accept value
	 */
	public void setAccept (java.lang.Integer accept) {
		this.accept = accept;
	}



	/**
	 * Return the value associated with the column: comment_freelance
	 */
	public java.lang.String getCommentFreelance () {
		return commentFreelance;
	}

	/**
	 * Set the value related to the column: comment_freelance
	 * @param commentFreelance the comment_freelance value
	 */
	public void setCommentFreelance (java.lang.String commentFreelance) {
		this.commentFreelance = commentFreelance;
	}



	/**
	 * Return the value associated with the column: comment_manager
	 */
	public java.lang.String getCommentManager () {
		return commentManager;
	}

	/**
	 * Set the value related to the column: comment_manager
	 * @param commentManager the comment_manager value
	 */
	public void setCommentManager (java.lang.String commentManager) {
		this.commentManager = commentManager;
	}



	/**
	 * Return the value associated with the column: grade_freelance
	 */
	public java.lang.Integer getGradeFreelance () {
		return gradeFreelance;
	}

	/**
	 * Set the value related to the column: grade_freelance
	 * @param gradeFreelance the grade_freelance value
	 */
	public void setGradeFreelance (java.lang.Integer gradeFreelance) {
		this.gradeFreelance = gradeFreelance;
	}



	/**
	 * Return the value associated with the column: grade_manager
	 */
	public java.lang.Integer getGradeManager () {
		return gradeManager;
	}

	/**
	 * Set the value related to the column: grade_manager
	 * @param gradeManager the grade_manager value
	 */
	public void setGradeManager (java.lang.Integer gradeManager) {
		this.gradeManager = gradeManager;
	}



	/**
	 * Return the value associated with the column: message
	 */
	public java.lang.String getMessage () {
		return message;
	}

	/**
	 * Set the value related to the column: message
	 * @param message the message value
	 */
	public void setMessage (java.lang.String message) {
		this.message = message;
	}



	/**
	 * Return the value associated with the column: salary
	 */
	public double getSalary () {
		return salary;
	}

	/**
	 * Set the value related to the column: salary
	 * @param salary the salary value
	 */
	public void setSalary (double salary) {
		this.salary = salary;
	}



	/**
	 * Return the value associated with the column: freelance_id
	 */
	public org.insia.smartposse.mapping.Users getFreelance () {
		return freelance;
	}

	/**
	 * Set the value related to the column: freelance_id
	 * @param freelance the freelance_id value
	 */
	public void setFreelance (org.insia.smartposse.mapping.Users freelance) {
		this.freelance = freelance;
	}



	/**
	 * Return the value associated with the column: from_id
	 */
	public org.insia.smartposse.mapping.Users getFrom () {
		return from;
	}

	/**
	 * Set the value related to the column: from_id
	 * @param from the from_id value
	 */
	public void setFrom (org.insia.smartposse.mapping.Users from) {
		this.from = from;
	}



	/**
	 * Return the value associated with the column: job_project_id
	 */
	public org.insia.smartposse.mapping.JobProject getJobProject () {
		return jobProject;
	}

	/**
	 * Set the value related to the column: job_project_id
	 * @param jobProject the job_project_id value
	 */
	public void setJobProject (org.insia.smartposse.mapping.JobProject jobProject) {
		this.jobProject = jobProject;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof org.insia.smartposse.mapping.Application)) return false;
		else {
			org.insia.smartposse.mapping.Application application = (org.insia.smartposse.mapping.Application) obj;
			if (null == this.getId() || null == application.getId()) return false;
			else return (this.getId().equals(application.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}